using Tools.Common.ServiceLocator;
using Tools.Domain.Specifications.Constraints;
using Webshop20.Application.Queries.Messages;
using Webshop20.Domain.Customers.Core;

namespace Webshop20.Application.Queries.Services
{
    public interface IGetCustomerValidationInformationService: IService{}

    public class GetCustomerValidationInformationService : ServiceBase, IGetCustomerValidationInformationService
    {
        readonly IServiceLocator serviceLocator;

        public GetCustomerValidationInformationService(IServiceLocator serviceLocator)
        {
            this.serviceLocator = serviceLocator;
        }


        public override ISystemMessage Handle(ISystemMessage request)
        {
            var customerConstraintSet = serviceLocator.Resolve<IConstraintSet<Customer>>();
            return new GetCustomerValidationInformationResponse(customerConstraintSet);            
        }
    }
}